package life.system.auth.controller;


import life.system.auth.service.WechatService;
import life.system.auth.vo.WechatLoginRequest;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/auth")
public class MiniProgramLogin {

    @Resource
    WechatService wechatService;

    @PostMapping("/login")
    public Map<String, Object> login(
            @RequestBody WechatLoginRequest loginRequest) throws Exception {

        return wechatService.getUserInfoMap(loginRequest);
    }
}

